package com.sc.nft.dao;

import com.sc.nft.enums.BannerPositionEnum;
import lombok.extern.slf4j.Slf4j;
import com.sc.nft.entity.DaoBanner;
import com.sc.nft.mapper.DaoBannerMapper;
import  com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * (sc_dao_banner)数据DAO
 *
 * @author zxy
 * @since 2023-10-21 14:55:27
 * @description 商户banner
 */
@Slf4j
@Repository
public class DaoBannerDao extends ServiceImpl<DaoBannerMapper, DaoBanner> {

    public List<DaoBanner> getByDaoId(Long daoId, BannerPositionEnum position){
        return lambdaQuery().eq(DaoBanner::getDaoId,daoId).eq(DaoBanner::getShowPosition,position).eq(DaoBanner::getStatus,true).orderByDesc(DaoBanner::getSort).list();
    }
}